
#include <stdio.h>
#include "STLOG.h"
#include "STL_Json.h"
#include <unistd.h>
#include "STL_Linux.h"

using namespace STL;

int main(int argc, char **argv)
{
    stl_daemonlock();

    // const char *net = "eth0";
    const char *net = "br-bf597a8a5676";
    char ip[32] = {0};
    char mac[32] = {0};
    get_local_ip(net, ip);
    get_mac_addr(net, mac);
    printf("ip:%s\n", ip);
    printf("mac:%s\n", mac);

    // MEM_OCCUPY mem_stat;
    // CPU_OCCUPY cpu_stat1;
    // CPU_OCCUPY cpu_stat2;
    // System_Info sysInfo;

    // STL::get_top_parse_info(&sysInfo);

    // //获取内存
    // //(MemTotal - MemFree)/ MemTotal
    // get_memoccupy((MEM_OCCUPY *)&mem_stat);
    // //printf(" [MemTotal] = %lu \n [MemFree] = %lu \n [Buffers] = %lu \n [Cached] = %lu \n [SwapCached] = %lu \n", mem_stat.MemTotal, mem_stat.MemFree, mem_stat.Buffers, mem_stat.Cached, mem_stat.SwapCached);
    // printf("%.3f\n", mem_stat.MemFree * 1.0 / (mem_stat.MemTotal * 1.0));
    // //第一次获取cpu使用情况
    // get_cpuoccupy((CPU_OCCUPY *)&cpu_stat1);

    // usleep(100000);

    // //第二次获取cpu使用情况
    // get_cpuoccupy((CPU_OCCUPY *)&cpu_stat2);
    // //计算cpu使用率
    // cal_cpuoccupy((CPU_OCCUPY *)&cpu_stat1, (CPU_OCCUPY *)&cpu_stat2);
    return 0;
}